﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Net.DesignByContract;

namespace Common.Net.DataStructures
{
    public class Disposable : IDisposable
    {
        readonly Action _onDispose;

        public Disposable(Action onDispose)
        {
        	RequireArg.NotNull(() => onDispose);

            _onDispose = onDispose;
        }

        public void Dispose()
        {
            _onDispose();
        }
    }
}
